﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace DispatchingService.CustomJob
{
    public class SayHiJob : IJob  
    {
        public SayHiJob()
        {
            Console.WriteLine("SayHiJob被构造了");
        } 
        /// <summary>
        /// 当前Task内部就作业休要执行的任务
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public async Task Execute(IJobExecutionContext context)
        {
            await Task.Run(() =>
            {
                Console.WriteLine();
                Console.WriteLine("**************************************");
                Console.WriteLine($"大家好！我是Richard老师！欢迎大家来朝夕教育跟Richard老师学习.Net高级开发！{DateTime.Now}");
                Console.WriteLine("**************************************");
                Console.WriteLine();
            });
        }
    }
}
